<template>
  <div class="home">
    <div class="show">
      <img ref="coverimage" alt="" src="" />
    </div>

    <button @click="showpic">显示图片</button>
  </div>
</template>

<script>
import { bus } from "../../utils/globalbus";
// import { mapGetters } from "vuex";
export default {
  name: "Home",
  components: {},
  data() {
    return {};
  },
  mounted() {
    this.$refs.coverimage.src = bus.data;
  },
  computed: {
    // ...mapGetters(["src"]),
  },
  methods: {
    showpic() {
      console.log(2321231);
      console.log(bus.data);
      this.$refs.coverimage.src = bus.data;
    },
  },
};
</script>
